package com.ksd.modules.fileRecord.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ksd.common.controller.BaseController;
import com.ksd.common.core.result.R;
import com.ksd.modules.fileRecord.po.SysFileRecordSavePo;
import com.ksd.modules.fileRecord.po.SysFileRecordSearchPo;
import com.ksd.modules.fileRecord.service.ISysFileRecordService;
import com.ksd.modules.fileRecord.vo.SysFileRecordVo;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 文件上传记录表 前端控制器
 * </p>
 *
 * @author Auto Generator
 * @since 2023-09-17
 */
@RestController
public class SysFileRecordController extends BaseController {
    @Resource
    private ISysFileRecordService iSysFileRecordService;
    @PostMapping("/sysFileRecord/load")
    @ResponseBody
    public R<Page<SysFileRecordVo>> getList(@RequestBody SysFileRecordSearchPo param) {
        return R.data(iSysFileRecordService.getList(param));
    }
    @PostMapping("/sysFileRecord/saveupdate")
    public R<Boolean> saveUpdateMayaAdvertment(@Validated @RequestBody SysFileRecordSavePo adminAdvertMentSavePO){
        return R.data(iSysFileRecordService.saveUpdate(adminAdvertMentSavePO));
    }

    @PostMapping("/sysFileRecord/statistics")
    public R<List<Map<String,Object>>> statistics(){
        return R.data(iSysFileRecordService.statistics());
    }
}
